package com.shuoyue.ycgk.ui.mine.wrong;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shuoyue.ycgk.R;
import com.shuoyue.ycgk.base.baseadapter.AppBaseQuickAdapter;
import com.shuoyue.ycgk.entity.SectionType;

import java.util.List;

public class SectionAdapter extends AppBaseQuickAdapter<SectionType> {
    boolean isDelete = false;

    public SectionAdapter(@Nullable List<SectionType> data) {
        super(R.layout.item_wrong_type, data);

    }

    public boolean isDelete() {
        return isDelete;
    }

    public void setDelete(boolean delete) {
        isDelete = delete;
    }

    @Override
    protected void convert(BaseViewHolder helper, SectionType item) {
        helper.addOnClickListener(R.id.lay_done);
        helper.addOnClickListener(R.id.delete);
        helper.addOnClickListener(R.id.lay_redone);
        helper.setText(R.id.title, item.getSectionName());
        helper.setText(R.id.done, String.valueOf(item.getConsolidate()));
        helper.setText(R.id.redone, String.valueOf(item.getUnConsolidate()));
        helper.setVisible(R.id.icon, false);
        helper.setGone(R.id.lay_num, true);
        helper.setGone(R.id.delete, isDelete);
        helper.setGone(R.id.sum, false);
        helper.setGone(R.id.lay_done, item.getConsolidate() != 0);

    }


}
